import React,{useEffect} from 'react'
import {useLocation} from "react-router-dom"
function Detail() {
   let location = useLocation()
   console.log(location.state.tit);
   // 富文本就是一些带有样式的文本，在react中理解为vue的v-html
    useEffect(()=>{
        location.state.tit = `<h4 style="color:red">${location.state.tit}<h4>`
    },[])
  return (
    <div dangerouslySetInnerHTML={{__html:location.state.tit}}></div>
  )
}

export default Detail